package com.igeek.clud_system.myapp;

import com.igeek.clud_system.dao.ActivityDao;
import com.igeek.clud_system.service.ActivityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class Myapp1 {

    @Autowired
    private ActivityService activityService;

    /**
     * 对活动开始时发送
     */
    @Scheduled(fixedRate = 3600000) // 每小时执行一次
    public void customFunction() {
        System.out.println("线程一开始");
        activityService.setTime();
    }
}